#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char **argv)
{
	string call1("nachos -T -rs ");
	string call2("nachos -P2 -rs ");	// if you need an input stream...
	int error;
	int cmd;
	int rs;
	string tmp;
	bool quit = false;
	while (!quit) {
		printf("1. nachos -T -rs \n");
		printf("2. nachos -P2 -rs \n");
		printf("3. quit\n");
		printf("Please enter the number 1-3 corresponding to above options: ");
		cin >> cmd;
		switch (cmd) {
			case 1:
				printf("Please enter the rs number: ");
				cin >> tmp;
				call1 += tmp;
				error = system(call1.data());
				break;
			case 2:
				printf("Please enter the rs number: ");
				cin >> tmp;
				call2 += tmp;
				error = system(call2.data());
				break;
			case 3:
				quit = true;
				break;
			default:
				printf("There is no such command\n");
				break;
		}
	}
	return error;
}
